<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<html>
<head>
<script type="text/javascript" src="<%=path%>/scripts/My97DatePicker/WdatePicker.js"></script>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>日常考勤列表</title>
<link href="styles/core.css" rel="stylesheet" type="text/css">
<link href="styles/Master.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="scripts/jquery/jquery.js"></script>
<script type="text/javascript" src="scripts/common.js"></script>

<link href="scripts/My97DatePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
var basePath = "<%=basePath%>";
</script>
<script type="text/javascript" src="scripts/attendance/attendance.js"></script>
</head>
<body>
<form  name="attendanceForm" method="post" onsubmit="return false;">
<s:hidden name="pagerEntity.pageInfo.pageNow" id="pageNow"></s:hidden>
<h2 style="text-align: left">考勤记录列表</h2>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td align="right" width="15%">
			工作人员编号：
			<s:if test='#session._login_user_info.isAdmin'>
				<input type="button" value="..." class="btn_mouseout" onclick="selectWorker();return false;"
					onmouseover="this.className='btn_mouseover'" onmouseout="this.className='btn_mouseout'"
					onmousedown="this.className='btn_mousedown'" onmouseup="this.className='btn_mouseup'">
			<s:set id="readOnly" value="false"></s:set>
			</s:if>
			<s:else>
			<s:set id="readOnly" value="true"></s:set>
			</s:else>
		</td>
		<td align="left" width="28%">
			<s:textfield name="searchEntity.workerCode" id="workerCode" cssClass="input" onblur="return getWorkerInfo();"
				readonly="#readOnly"></s:textfield>
			<s:label id="workerName" name="searchEntity.workerName"></s:label>
			<s:hidden id="hdnWorkerName" name="searchEntity.workerName"></s:hidden>
		</td>
		<td align="right" width="15%">
			出勤状况：
		</td>
		<td align="left">
			<s:select name="searchEntity.status"  id="status" list="#request.attendanceStatusList" listKey="columeId" listValue="name" headerKey="" headerValue="" required="true" cssStyle="width: 150px;" ></s:select>
		</td>
		<td align="right" width="15%" rowspan="2">
			<input type="image" src="<%=basePath%>images/search.jpg" onclick="search();"></input>
			<!-- <input type="image" src="<%=basePath%>images/excel.jpg" onclick="exportExcel();"></input>
			<input type="image" src="<%=basePath%>images/add.jpg" onclick="add();"></input> -->
		</td>
	</tr>
	<tr>
		<td align="right">
			考勤日期：
		</td>
		<td align="left" colspan="3">
			<s:textfield cssClass="Wdate" onclick="WdatePicker({el:'checkDateStart', dateFmt:'yyyy-MM-dd'})"
					name="searchEntity.checkDateStart" id="checkDateStart" cssStyle="width: 90px;">
				<s:param name="value">
					<s:date name="searchEntity.checkDateStart" format="yyyy-MM-dd"/>
				</s:param>
			</s:textfield>
			&nbsp;~&nbsp;
			<s:textfield cssClass="Wdate" onclick="WdatePicker({el:'checkDateEnd', dateFmt:'yyyy-MM-dd'})"
					name="searchEntity.checkDateEnd" id="checkDateEnd" cssStyle="width: 90px;">
				<s:param name="value">
					<s:date name="searchEntity.checkDateEnd" format="yyyy-MM-dd"/>
				</s:param>
			</s:textfield>
		</td>
	</tr>
</table>
<hr width="100%" align="left" size="1" color="#E1EEF8">
<table width="100%" border="0" cellpadding="0" cellspacing="0"
	class="tabHeader" id="dataInfo">
	<thead>
		<tr align="center" class="tdBg">
			<td style="text-align: center" nowrap="nowrap" width="10%">出勤编号</td>
			<td style="text-align: center" nowrap="nowrap" width="20%">工作人员</td>
			<td style="text-align: center" nowrap="nowrap" width="20%">考勤日期</td>
			<td style="text-align: center" nowrap="nowrap" width="20%">出勤状态</td>
			<td style="text-align: center" nowrap="nowrap" width="20%">出勤时间</td>
			<td style="text-align: center" nowrap="nowrap" width="10%">操作</td>
		</tr>
	</thead>
	<tbody>
		<s:if test="#request.pagerEntity.resultList.size==0">
	   		<tr>
	   			<td colspan="9" align="center">
	   				对不起！没有搜索到结果......
	   			</td>
	   		</tr>
	   	</s:if>
	   	<s:else>
			<s:set id="total" value="0"></s:set>
		    <s:set id="totalSum" value="0"></s:set>
			<s:iterator value="pagerEntity.resultList" id="attendanceRecord">
				<tr>
					<td align="center">
						<s:property value="#attendanceRecord.attendanceId"/>
					</td>
					<td align="left">
						<s:property value="#attendanceRecord.workerCode"/>&nbsp;<s:property value="#attendanceRecord.workerName"/>
					</td>
					<td align="center">
						<s:property value="#attendanceRecord.checkDateStr"/>
					</td>
					<td align="center">
						<s:property value="#attendanceRecord.statusName"/>
					</td>
					<td align="center">
						<s:property value="#attendanceRecord.attendanceTime"/>
					</td>
					<td nowrap="nowrap" align="center">
						<s:url id="modifyAttendance" value="attendance/attendance-modify.action">
			        		 <s:param name="attendanceRecord.attendanceId" value="#attendanceRecord.attendanceId"></s:param>
			    		</s:url>
			    		<s:url id="deleteAttendance" value="attendance/attendance-delete.action">
			        		 <s:param name="attendanceRecord.attendanceId" value="#attendanceRecord.attendanceId"></s:param>
			    		</s:url>
		    			<s:if test='#session._login_user_info.isAdmin'>
				    		<s:a href="%{deleteAttendance}" onclick="return delpay()">
								<img src="images/delete.jpg" style="vertical-align: middle" border="0">删除&nbsp;&nbsp;
							</s:a>
							<s:a href="%{modifyAttendance}">
								<img src="images/update.jpg" style="vertical-align: middle" border="0">修改
							</s:a>
						</s:if>
					</td>
				</tr>
			</s:iterator>
			<tr class="tdBg">
				<td colspan="6" align="right">
					<s:include value="/pages/pagefooter.jsp"></s:include>
				</td>
			</tr>
		</s:else>
	</tbody>
</table>
</form>
</body>
</html>